/**
 * Copyright (c) 2009 Netflix-Flex_API Contributors.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of 
 * this software and associated documentation files (the "Software"), to deal in 
 * the Software without restriction, including without limitation the rights to 
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 * of the Software, and to permit persons to whom the Software is furnished to do 
 * so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all 
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE. 
 * */
package com.netflix.webapis.events
{
	import flash.events.Event;
	
	import mx.events.PropertyChangeEvent;
	
	/**
	 * NetflixPropertyChangeEvent fired after results are returned from expansions and service events.
	 * @author jonbcampos
	 * 
	 */	
	public class NetflixPropertyChangeEvent extends Event
	{
		public static const PROPERTY_CHANGED:String = "propertyChanged";
		
		private var _value:Object;
		/**
		 * New Value. 
		 * @return 
		 * 
		 */		
		public function get value():Object
		{
			return _value;
		}
		
		private var _prevValue:Object;
		/**
		 * Old Value. 
		 * @return 
		 * 
		 */		
		public function get prevValue():Object
		{
			return _prevValue;
		}
		
		private var _property:String;
		/**
		 * Property Changed. 
		 * @return 
		 * 
		 */		
		public function get property():String
		{
			return _property;
		}
		
		private var _source:Object;
		/**
		 * Item that' property changed. 
		 * @return 
		 * 
		 */		
		public function get source():Object
		{
			return _source;
		}
		
		public function NetflixPropertyChangeEvent(type:String, value:Object, prevValue:Object, property:String, source:Object, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_value = value;
			_prevValue = prevValue;
			_property = property;
			_source = source;
		}
		
		override public function clone():Event
		{
			return new NetflixPropertyChangeEvent(type,value,prevValue,property,source,bubbles,cancelable);
		}
	}
}